package com.lzx.adx.report.support.lifecycle;
/**
 *
 * @since 2021/12/11 0:32
 */
import com.lzs.adx.commmon.utils.SpringContextUtils;
import com.lzx.adx.report.service.AccountService;
import com.lzx.adx.report.service.OcpxAccountService;
import com.lzx.adx.report.service.ProductConfigService;
import com.lzx.adx.report.service.WphLimitService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.SmartLifecycle;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class AgencyFactoryLifeCycle implements SmartLifecycle {
    @Autowired
    private AccountService accountService;
    @Autowired
    private ProductConfigService productConfigService;
    @Autowired
    private OcpxAccountService ocpxAccountService;

    @Autowired
    private WphLimitService wphLimitService;



    @Override
    public void start() {
        //账户同步
        accountService.sysnCacheToDb();
        //账户同步
        ocpxAccountService.sysnCacheToDb();
        //产品配置同步
        productConfigService.sysnCacheToDb();

        //限流
        wphLimitService.sysnCacheToDb();
    }
    @Override
    public void stop() {
    }
    @Override
    public boolean isRunning() {
        return false;
    }
}